# -*- coding: utf-8 -*-

import tkinter as tk  
  
# 创建主窗口  
root = tk.Tk()  
  
# 设置窗口标题  
root.title("Hello World!")  
  
# 设置窗口大小  
root.geometry("300x200")  
  
# 添加标签  
label = tk.Label(root, text="Hello World!")  
label.pack()  
  
# 添加按钮  
button = tk.Button(root, text="Click Me!", command=lambda: label.config(text="You clicked me!"))  
button.pack()  
  
# 运行主循环  
root.mainloop()
